package com.cg.design.graphicdesignpattern.factory;

import com.cg.design.graphicdesignpattern.factory.framework.Factory;
import com.cg.design.graphicdesignpattern.factory.framework.Product;
import com.cg.design.graphicdesignpattern.factory.idcard.IDCardFactory;
import org.junit.Test;

/**
 * 测试类
 *
 * @program: LeetCode->FactoryTest
 * @description: 测试类
 * @author: cg
 * @create: 2022-03-19 14:48
 **/
public class FactoryTest {

    @Test
    public void testFactory() {
        Factory factory = new IDCardFactory();
        Product card1 = factory.create("xiaoming");
        Product card2 = factory.create("xiaohong");
        Product card3 = factory.create("xiaogang");
        card1.use();
        card2.use();
        card3.use();
    }

}
